Skip to content

Fix var_export(array pointer) string-concat mis-bind (#13829) - #13894

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-13829-key-concat-var-export
Jun 30, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-13829-key-concat-var-export

Conversation

@PurHur

@PurHur PurHur commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • Symptom manifests via ext/standard/array.c pointer builtins; fix is compile-time arg wiring (lib/Compiler.php, Zend/zend_compile.c SEND/inline-call pattern).

Verification

./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit test/unit/InlineCallArgProducerSlotTest.php --filter testVarExportNestedArrayPointerBuiltinUsesFuncCallProducerSlot'
# OK (1 test)

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_key_concat_operand.php'
# ok

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/compliance/cases/stdlib/array_pointer_var_export_concat.phpt'
# key=1 / current=2 / end=3

./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r "\$a=[1,2,3]; next(\$a); echo \"key=\".var_export(key(\$a),true).\"\\n\";"'
# key=1 (was key=true)

Closes #13829

Made with Cursor

php-cfg hoists key()/current()/… as siblings before var_export with distinct dead arg temps; wire hoisted FuncCall return slots and skip ConstFetch true mis-binding on var_export arg #0. Also fixes #13811 prev/next/end concat regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant